package com.julu.o2o.common;

import com.jfinal.core.Controller;
import com.julu.o2o.bean.PageIndex;
import com.julu.o2o.bean.Paging;

public class PageIndexHelper {
	
	/**
	 * 设置分页条信息
	 * @param c 当前控制器
	 * @param p ice回传后的page
	 */
	public static void setPaging(Controller c,Paging<?> page){			
		PageIndex pageIndex = PageIndex.getPageIndex(Paging.PAGINATION_SIZE, page.getPageNumber(), page.getTotalPage());			
		c.setAttr("pageIndex", pageIndex);		
	}
}
